    
    #include "os_cfg.h"
    .text
    .extern kernel_init
    .extern init_main
    .global _start
    # void start(boot_info_t * boot_info)
_start:
    # 
    push %ebp
    mov %esp, %ebp
    mov  0x8(%ebp), %eax


    # 相当于kernel_init(boot_info)
    push 4(%eax)
    call kernel_init

    jmp $KERNEL_SELECTOR_CS , $gdt_reload
gdt_reload:
    mov $KERNEL_SELECTOR_DS, %ax
	mov %ax, %ds
	mov %ax, %ss
	mov %ax, %es
	mov %ax, %fs
	mov %ax, %gs

    mov $(stack + KERNEL_STACK_SIZE), %esp

    jmp init_main

    .bss
.comm stack,KERNEL_STACK_SIZE 